//
//  LikeViewController.m
//  ios-test
//
//  Created by Apple -11 on 15/10/16.
//  Copyright (c) 2015年 Apple -11. All rights reserved.
//

#import "LikeViewController.h"

@interface LikeViewController ()

@end

@implementation LikeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.cellNib=[UINib nibWithNibName:@"likeTableViewCell" bundle:nil];
    
    NSString *path=[[NSBundle mainBundle] pathForResource:@"goods" ofType:@"plist"];
    self.goodsArray=(NSMutableArray *)[NSArray arrayWithContentsOfFile:path];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)viewWillAppear:(BOOL)animated{
    //self.goodsArray=[share objectForKey:@"share"];
    [myTableView reloadData];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.goodsArray.count;
    //NSLog(@"--------%@------",self.forivteArray.count);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *cellStr=@"Cell";
    likeTableViewCell *cell=(likeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellStr];
    if(cell==nil)
    {
        [self.cellNib instantiateWithOwner:self options:nil];
        cell=self.myGoodsCell;
        self.myGoodsCell=nil;
    }
    
    
    NSDictionary *dict=[self.goodsArray objectAtIndex:indexPath.row];
    cell.title.text=dict[@"title"];
    cell.icon.image=[UIImage imageNamed:dict[@"icon"]];
    cell.price.text=[NSString stringWithFormat:@"￥%@",dict[@"price"]];
    
    return cell;
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
